package com.jianghang.class_three

import java.net.URI

import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.fs.{FileSystem, Path}

object HDFSApi {

  val conf = new Configuration()

  def main(args: Array[String]): Unit = {
    delete()
  }


  def delete()={
    val output = "hdfs://hadoop000:8020/etl/access8/hbase"
    val outputPath = new Path(output)

    val outputPath1 = new Path("/etl/access8/hbase")
    val HDFS_URL = "hdfs://hadoop000:8020"
    val fileSystem = FileSystem.get(new URI(HDFS_URL), conf, "hadoop")

    if (fileSystem.exists(outputPath1)) {
      val bool = fileSystem.delete(outputPath1, true)
      println(bool)
    }
  }

}
